<template>
  <v-card>
    <v-card-title>
      审核管理
    </v-card-title>
    <v-tabs
        fixed-tabs
    >
      <v-tab>认领相关</v-tab>
      <v-tab>认领处理记录</v-tab>
      <v-tab>申诉相关</v-tab>

      <v-tab-item>
        <apply-check v-if="isRouterAlive"/>
      </v-tab-item>
      <v-tab-item>
        <have-dealt  v-if="isRouterAlive"/>
      </v-tab-item>
      <v-tab-item>
        <claim-check v-if="isRouterAlive"/>
      </v-tab-item>

    </v-tabs>
  </v-card>
</template>

<script>
import ApplyCheck from "./ApplyCheck";
import HaveDealt from "./HaveDealt";
import ClaimCheck from "./ClaimCheck";
export default {
  name: "Admin",
  components: {HaveDealt, ApplyCheck, ClaimCheck},
  provide () {
    return {
      reload: this.reload
    }
  },
  data() {
    return{
      isRouterAlive: true
    }
  },
  methods: {
    reload () {
      this.isRouterAlive = false;
      this.$nextTick(function () {
        this.isRouterAlive = true;
      })
    },
    checkAdmin(){
      if(JSON.parse(localStorage.getItem('userinfo')).profile.identity !== 'admin'){
        this.$router.push({path: '/'})
        this.$notify.error({
          title: '你没有管理员的权限',
          message: '想啥呢'
        })
      }
    }
  },
  mounted() {
    this.checkAdmin();
  }
}
</script>

<style lang="scss">
.v-data-table > .v-data-table__wrapper > table > tbody > tr > td,
.v-data-table > .v-data-table__wrapper > table > thead > tr > th, {
  font-size: 15px !important;
}
</style>